<?php
class CommonUtil{

    public static function curl_test($url, $fields)
    {
        $cp = curl_init($url);
        curl_setopt($cp, CURLOPT_POST, 1 );
        if (!empty($fields))
        {
            curl_setopt($cp, CURLOPT_POSTFIELDS, $fields);
        }
        curl_setopt($cp,CURLOPT_RETURNTRANSFER,1);
        $ret = curl_exec($cp);
        $err_num = curl_errno($cp);
        if ($err_num > 0) return false;
        curl_close($cp);
        return $ret;
    }
}

